package com.centaline.androidsalesblog.model.databaseobject;

import com.google.gson.annotations.SerializedName;

import org.litepal.crud.DataSupport;

import java.util.ArrayList;

/**
 * 地铁线路
 * Created by guilin on 16/1/19.
 */
public class RailLineDo extends DataSupport {

    private String cityCode;
    private int RailLineID;
    private String RailLineName;
    @SerializedName("RailWayList")
    private ArrayList<RailWayDo> list;

    public String getCityCode() {
        return cityCode;
    }

    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }

    public int getRailLineID() {
        return RailLineID;
    }

    public void setRailLineID(int railLineID) {
        RailLineID = railLineID;
    }

    public String getRailLineName() {
        return RailLineName;
    }

    public void setRailLineName(String railLineName) {
        RailLineName = railLineName;
    }

    public ArrayList<RailWayDo> getList() {
        return list;
    }

    public void setList(ArrayList<RailWayDo> list) {
        this.list = list;
    }

    /**
     * 查找地铁站
     */
    public void findRailWayList() {
        list = new ArrayList<>();
        list.addAll(DataSupport.where("cityCode = ? and RailLineID = ?", cityCode, String.valueOf(RailLineID))
                .find(RailWayDo.class));
    }
}
